## 3.2.7 Ferris Wheel --------------- ### 3.2.7.1 Overview ![Img](./media/top1.png) Here we build a Ferris wheel with a Micro:bit V2 board, a servo expansion board, a 360° LEGO servo and some LEGO parts. We program to control the rotation of the Ferris wheel through the Micro:bit V2 buttons A and B. ![Img](./media/bottom1.png) --------------- ### 3.2.7.2 Materials Required ![Img](./media/A7-0.png) --------------- ### 3.2.7.3 Installation Steps ![Img](./media/2top.png) ![Img](./media/A7-1.png) ![Img](./media/A7-2.png) ![Img](./media/A7-3.png) ![Img](./media/A7-4.png) ![Img](./media/A7-5.png) ![Img](./media/A7-6.png) ![Img](./media/A7-7.png) ![Img](./media/A7-8.png) ![Img](./media/A7-9.png) ![Img](./media/A7-10.png) ![Img](./media/A7-11.png) ![Img](./media/A7-12.png) ![Img](./media/A7-13.png) ![Img](./media/A7-14.png) ![Img](./media/A7-15.png) ![Img](./media/A7-16.png) ![Img](./media/A7-17.png) ![Img](./media/A7-18.png) ![Img](./media/A7-19.png) ![Img](./media/A7-20.png) ![Img](./media/A7-21.png) ![Img](./media/A7-22.png) ![Img](./media/A7-23.png) ![Img](./media/A7-24.png) ![Img](./media/A07.png) ![Img](./media/wiring7.jpg) ![Img](./media/A7-25.png) ![Img](./media/A7-26.png) ![Img](./media/A7-27.png) ![Img](./media/A7-28.png) ![Img](./media/A7-29.png) ![Img](./media/A7-30.png) ![Img](./media/A7-31.png) ![Img](./media/A7-32.png) ![Img](./media/A7-33.png) ![Img](./media/A7-34.png) ![Img](./media/A7-35.png) ![Img](./media/A7-36.png) ![Img](./media/A7-37.png) ![Img](./media/A7-38.png) ![Img](./media/A7-39.png) ![Img](./media/A7-40.png) ![Img](./media/A7-41.png) ![Img](./media/A7-42.png) ![Img](./media/A7-43.png) ![Img](./media/A7-44.png) ![Img](./media/A7-45.png) ![Img](./media/2bottom.png) --------------- ### 3.2.7.4 Test Code The speed value 30 in the code can be adjusted appropriately according to your needs. ![Img](./media/couj07.png) ⚠️ **Special reminder: You can obtain the sample code through the following two methods.** #### **Method 1: drag and drop code blocks to build the sample code** **1. MakeCode programming environment** The online version of MakeCode: [MakeCode editor](https://makecode.microbit.org/#editor) **2. MakeCode extension library** ⚠️ **Special reminder: ** Copy and paste the link: `https://github.com/keyestudio2019/pxt-creative-inventors-kit-master.git` into the search box to import the library. ![Img](./media/Animation-4.gif) **3. Write the sample code** ![Img](./media/dongtu-07.gif) #### **Method 2: download the sample code file directly** **1. Download the code file** Click to download the code file: [3_3_7_Ferris_Wheel](./Codes/3_3_7_Ferris_Wheel.hex) **2. MakeCode programming environment** The online version of MakeCode: [MakeCode editor](https://makecode.microbit.org/#editor) **3. Load the sample code** Drag and drop the sample code to the MakeCode editor. ![Img](./media/Animation-0007.gif) ![Img](./media/line1.png) --------------- ### 3.2.7.5 Test Result ![Img](./media/4top.png) Wire up and power on through Micro USB cable, and connect an external power source (four AAA-1.5V batteries installed in the battery box, ensuring sufficient power). To download the sample code using an online browser, you need to send the downloaded "**.hex**" file to the Micro:bit V2 board. There are two ways as follows: **① Download through WebUSB** For browsers like **Google Chrome / Microsoft Edge**, you need to click "**Connect Device**" to pair the device first. After that, click "**Download**" to load the sample code to the Micro:bit V2 board. ![Img](./media/Animation-07.gif) **② Download without WebUSB** For browsers like **Safari / Firefox / Other**, download and send the sample code to the Micro:bit V2 board. ![Img](./media/Animation-007.gif) After downloading the sample code, unplug the Micro USB cable to the Micro:bit V2 board. Turn the DIP switched to the RGB and ON. ![Img](./media/CBA01.png) Press button A on the Micro:bit V2 board and release it, the Ferris wheel starts to turn, these SK6812 RGB LEDs emit colorful light, and the 5×5 LED matrix displays ![Img](./media/ab3.png). Press button B on the Micro:bit V2 board and release it, the Ferris wheel stops, and these SK6812 RGB LEDs and the 5×5 LED matrix turn off. ![Img](./media/dongtu-007.gif) ![Img](./media/4bottom.png) ---------------